package com.ssyt.yt1.day22;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

/**
 * 控制台输入
 * 
 * @author Administrator
 *
 */
public class BufferedReaderDemo {

	public static void test1() throws IOException {
		BufferedReader bufferedReader = null;
		try {
			bufferedReader = new BufferedReader(
					new InputStreamReader(System.in));
			String line = bufferedReader.readLine();
			System.out.println(line);
		} finally {
			if (bufferedReader != null) {
				bufferedReader.close();
			}
		}
	}

	public static void test2() {
		Scanner scanner = null;
		try {
			scanner = new Scanner(System.in);
			System.out.println(scanner.nextLine());
		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	public static void main(String[] args) throws IOException {
		// test1();
		test2();
	}
}
